package com.etc.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * 订单信息的实体类
 * @author 
 *
 */
public class Orders {
	/**
	 * orderid 订单编号  主键
	 * ordersum 商品数量 
	 * orderdate 下单时间
	 * orderstate 订单状态    
	 * userid 买家编号  外键
	 * total 总花费
	 */
	private String orderid;
	private int ordersum;
	private String orderdate;
	private int orderstate;
	private int userid;
	private double total;
	
	private List<Items> items = new ArrayList<Items>();
	
	//无参构造
	public Orders() {
		// TODO Auto-generated constructor stub
	}
	/**订单号自增 的带参构造
	 * @param ordersum
	 * @param orderdate
	 * @param orderstate
	 * @param userid
	 * @param total
	 */
	public Orders(int ordersum, String orderdate, int orderstate, int userid, double total) {
		super();
		this.ordersum = ordersum;
		this.orderdate = orderdate;
		this.orderstate = orderstate;
		this.userid = userid;
		this.total = total;
	}
	
	/**
	 * 
	 * @param orderid
	 * @param ordersum
	 * @param userid
	 * @param total
	 */
	public Orders(String orderid, int ordersum, int userid, double total) {
		super();
		this.orderid = orderid;
		this.ordersum = ordersum;
		this.userid = userid;
		this.total = total;
	}
	
	
	public String getOrderid() {
		return orderid;
	}
	public void setOrderid(String orderid) {
		this.orderid = orderid;
	}
	/**
	 * @return the ordersum
	 */
	public int getOrdersum() {
		return ordersum;
	}

	/**
	 * @param ordersum the ordersum to set
	 */
	public void setOrdersum(int ordersum) {
		this.ordersum = ordersum;
	}

	/**
	 * @return the orderdate
	 */
	public String getOrderdate() {
		return orderdate;
	}

	/**
	 * @param orderdate the orderdate to set
	 */
	public void setOrderdate(String orderdate) {
		this.orderdate = orderdate;
	}

	/**
	 * @return the orderstate
	 */
	public int getOrderstate() {
		return orderstate;
	}

	/**
	 * @param orderstate the orderstate to set
	 */
	public void setOrderstate(int orderstate) {
		this.orderstate = orderstate;
	}

	/**
	 * @return the userid
	 */
	public int getUserid() {
		return userid;
	}

	/**
	 * @param userid the userid to set
	 */
	public void setUserid(int userid) {
		this.userid = userid;
	}

	/**
	 * @return the total
	 */
	public double getTotal() {
		return total;
	}

	/**
	 * @param total the total to set
	 */
	public void setTotal(double total) {
		this.total = total;
	}

	@Override
	public String toString() {
		return "Orders [orderid=" + orderid + ", ordersum=" + ordersum + ", orderdate=" + orderdate + ", orderstate="
				+ orderstate + ", userid=" + userid + ", total=" + total + ", items=" + items + "]";
	}
	/**
	 * @return the items
	 */
	public List<Items> getItems() {
		return items;
	}
	/**
	 * @param items the items to set
	 */
	public void setItems(List<Items> items) {
		this.items = items;
	}
	
	

}
